Learning Flex Basics (Part 1): Creating Your First Flex Application
Table of Contents
- Introduction
- A Brief Overview of Macromedia Flex
- Building the Application
- Create the Application Object
- Add a Panel for the Application Layout
- Add a Label for the View Header
- Add an Array of Objects to Define the Coffee Blends
- Add a ComboBox to Display the Coffee Blends
- Add a Text Control to Display the Description
- Add a Button to Add a Coffee Blend to the Shopping Cart
- Add a List Control for the Shopping Cart
- Add a Script to Handle the Button Click Event
- Complete Code Listing for firstapp.mxml
- Where to Go From Here
Add a Text Control to Display the Description
A Text control is similar to a Label, except that it can display multiline
data. Here you use it to display the description of the selected coffee
blend by binding it to the data associated with the item that the user
selected in the ComboBox. The data object is referenced as the selectedItem property
of the ComboBox.
-
After the ComboBox, add a Text control with the
textproperty, set to the literal string Description:, and add a binding to the data property of the selected item in the ComboBox:<mx:Text text="Description: {coffeeCombo.selectedItem.data}"/>